package com.candy.service.impl;

import com.candy.bean.UserInfo;
import com.candy.dao.UserInfoMapper;
import com.candy.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImpl implements LoginService {

    @Autowired
    UserInfoMapper userInfoMapper;
    /**
     * 登录
     * @param userInfo 用户输入的登录信息
     * @return 若用户名密码匹配返回true，反之返回false
     */
    @Override
    public boolean login(UserInfo userInfo) {
       UserInfo user= userInfoMapper.login(userInfo);
       if(user!=null){
           return true;
       }else {
        return false;
       }
    }
}
